home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7154 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  40 lines

  1. Path: reg.triumf.ca!bennett
  2. From: bennett@reg.triumf.ca (P.Bennett)
  3. Newsgroups: comp.lang.c++,comp.lang.c
  4. Subject: Re: Increasing stack size - HELP!
  5. Date: 21 Feb 1996 08:02 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <21FEB199608020960@reg.triumf.ca>
  9. References: <4gcd0h$8rf@izar.brunel.ac.uk>
  10. NNTP-Posting-Host: reg.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <4gcd0h$8rf@izar.brunel.ac.uk>, Francesco Fantauzzi <mapgfgf@brunel.ac.uk> writes...
  14. >Hi All!
  15. >I'm using Borland C++ 4.0. I'm stuck 'cause, when I run my program, it 
  16. >stops with a run-time error: "STACK OVERFLOW!". 
  17. >I checked the stack size (with stackavail()) and it's actually too small. 
  18. >How can I tell the compiler that I would like a larger stack, overriding 
  19. >the default size? I'm sure there's a way: I did it years ago, but have 
  20. >forgotten it. 
  21.  
  22. Look in the documentation for "_stklen"
  23.  
  24. I think you need to do:
  25. #include <dos.h>
  26. extern unsigned _stklen = 4096;
  27.  
  28. If you are running out of stack because you are using large automatic arrays,
  29. you might make them global or static instead - this will get them off the
  30. stack.
  31.  
  32. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  33. Internet: bennett@triumf.ca         | of one another only when one can be
  34. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  35. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  36. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  37.  
  38.